<!DOCTYPE html>
<html CN>


 




<head>
	
	
	<link rel="stylesheet" href="/css/allinone.min.css"> 

	
	<!-- Global Site Tag (gtag.js) - Google Analytics -->
	<script async src="https://www.googletagmanager.com/gtag/js?id=UA-42863699-1"></script>
	<script>
		window.dataLayer = window.dataLayer || [];
		function gtag(){dataLayer.push(arguments);}
		gtag('js', new Date());
		gtag('config', 'UA-42863699-1');
	</script>
	

	<meta charset="utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />

	<title>Archives | Cizixs Write Here</title>

	<meta name="HandheldFriendly" content="True" />
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
	<meta name="generator" content="hexo">
	<meta name="author" content="Cizixs Wu">
	<meta name="description" content="Container, Microservice, Python, Go, Reading, Life, And Love.">

	
	<meta name="keywords" content="hexo, casper, ghost, theme">
	

	
	<link rel="shortcut icon" href="https://cizixs-blog.oss-cn-beijing.aliyuncs.com/006tNc79ly1g1qxfovpzyj30740743yg.jpg">
	

	
	<meta name="theme-color" content="#3c484e">
	<meta name="msapplication-TileColor" content="#3c484e">
	

	

	

	<meta property="og:site_name" content="Cizixs Write Here">
	<meta property="og:type" content="blog">
	<meta property="og:title" content="Archives | Cizixs Write Here">
	<meta property="og:description" content="Container, Microservice, Python, Go, Reading, Life, And Love.">
	<meta property="og:url" content="http://cizixs.com/archives/2016/index.html">

	

	
<link rel="stylesheet" href="/css/prism-base16-ateliersulphurpool.light.css" type="text/css"></head>
<body class="tag-template">
    <div class="site-wrapper">
        




<header class="site-header outer  b-lazy" data-src="https://cizixs-blog.oss-cn-beijing.aliyuncs.com/006tNc79ly1g1qxcn9ft3j318w0txdo6.jpg">
    <div class="inner">
        
        
        
<nav class="site-nav"> 
    <div class="site-nav-left">
        <ul class="nav">
            <li>
                
                <a href="/" title="Home">Home</a>
                
            </li>
            
            
            <li>
                <a href="/about" title="About">About</a>
            </li>
            
            <li>
                <a href="/archives" title="Archives">Archives</a>
            </li>
            
            
        </ul> 
    </div>
    <div class="site-nav-right">
        
<div class="social-links" >
    
    <a class="social-link" title="weibo" href="https://weibo.com/1921727853" target="_blank" rel="noopener">
        <svg viewBox="0 0 1141 1024" xmlns="http://www.w3.org/2000/svg"><path d="M916.48 518.144q27.648 21.504 38.912 51.712t9.216 62.976-14.336 65.536-31.744 59.392q-34.816 48.128-78.848 81.92t-91.136 56.32-94.72 35.328-89.6 18.944-75.264 7.68-51.712 1.536-49.152-2.56-68.096-10.24-78.336-21.504-79.872-36.352-74.24-55.296-59.904-78.848q-16.384-29.696-22.016-63.488t-5.632-86.016q0-22.528 7.68-51.2t27.136-63.488 53.248-75.776 86.016-90.112q51.2-48.128 105.984-85.504t117.248-57.856q28.672-10.24 63.488-11.264t57.344 11.264q10.24 11.264 19.456 23.04t12.288 29.184q3.072 14.336 0.512 27.648t-5.632 26.624-5.12 25.6 2.048 22.528q17.408 2.048 33.792-1.536t31.744-9.216 31.232-11.776 33.28-9.216q27.648-5.12 54.784-4.608t49.152 7.68 36.352 22.016 17.408 38.4q2.048 14.336-2.048 26.624t-8.704 23.04-7.168 22.016 1.536 23.552q3.072 7.168 14.848 13.312t27.136 12.288 32.256 13.312 29.184 16.384zM658.432 836.608q26.624-16.384 53.76-45.056t44.032-64 18.944-75.776-20.48-81.408q-19.456-33.792-47.616-57.344t-62.976-37.376-74.24-19.968-80.384-6.144q-78.848 0-139.776 16.384t-105.472 43.008-72.192 60.416-38.912 68.608q-11.264 33.792-6.656 67.072t20.992 62.976 42.496 53.248 57.856 37.888q58.368 25.6 119.296 32.256t116.224 0.512 100.864-21.504 74.24-33.792zM524.288 513.024q20.48 8.192 38.912 18.432t32.768 27.648q10.24 12.288 17.92 30.72t10.752 39.424 1.536 42.496-9.728 38.912q-8.192 18.432-19.968 37.376t-28.672 35.328-40.448 29.184-57.344 18.944q-61.44 11.264-117.76-11.264t-88.064-74.752q-12.288-39.936-13.312-70.656t16.384-66.56q13.312-27.648 40.448-51.712t62.464-38.912 75.264-17.408 78.848 12.8zM361.472 764.928q37.888 3.072 57.856-18.432t21.504-48.128-15.36-47.616-52.736-16.896q-27.648 3.072-43.008 23.552t-17.408 43.52 9.728 42.496 39.424 21.504zM780.288 6.144q74.752 0 139.776 19.968t113.664 57.856 76.288 92.16 27.648 122.88q0 33.792-16.384 50.688t-35.328 17.408-35.328-14.336-16.384-45.568q0-40.96-22.528-77.824t-59.392-64.512-84.48-43.52-96.768-15.872q-31.744 0-47.104-15.36t-14.336-34.304 18.944-34.304 51.712-15.36zM780.288 169.984q95.232 0 144.384 48.64t49.152 146.944q0 30.72-10.24 43.52t-22.528 11.264-22.528-14.848-10.24-35.84q0-60.416-34.816-96.256t-93.184-35.84q-19.456 0-28.672-10.752t-9.216-23.04 9.728-23.04 28.16-10.752z" /></svg>
    </a>
    

    
    <a class="social-link" title="github" href="https://github.com/cizixs" target="_blank" rel="noopener">
        <svg viewBox="0 0 1049 1024" xmlns="http://www.w3.org/2000/svg"><path d="M524.979332 0C234.676191 0 0 234.676191 0 524.979332c0 232.068678 150.366597 428.501342 358.967656 498.035028 26.075132 5.215026 35.636014-11.299224 35.636014-25.205961 0-12.168395-0.869171-53.888607-0.869171-97.347161-146.020741 31.290159-176.441729-62.580318-176.441729-62.580318-23.467619-60.841976-58.234462-76.487055-58.234463-76.487055-47.804409-32.15933 3.476684-32.15933 3.476685-32.15933 53.019436 3.476684 80.83291 53.888607 80.83291 53.888607 46.935238 79.963739 122.553122 57.365291 152.97411 43.458554 4.345855-33.897672 18.252593-57.365291 33.028501-70.402857-116.468925-12.168395-239.022047-57.365291-239.022047-259.012982 0-57.365291 20.860106-104.300529 53.888607-140.805715-5.215026-13.037566-23.467619-66.926173 5.215027-139.067372 0 0 44.327725-13.906737 144.282399 53.888607 41.720212-11.299224 86.917108-17.383422 131.244833-17.383422s89.524621 6.084198 131.244833 17.383422C756.178839 203.386032 800.506564 217.29277 800.506564 217.29277c28.682646 72.1412 10.430053 126.029806 5.215026 139.067372 33.897672 36.505185 53.888607 83.440424 53.888607 140.805715 0 201.64769-122.553122 245.975415-239.891218 259.012982 19.121764 16.514251 35.636014 47.804409 35.636015 97.347161 0 70.402857-0.869171 126.898978-0.869172 144.282399 0 13.906737 9.560882 30.420988 35.636015 25.205961 208.601059-69.533686 358.967656-265.96635 358.967655-498.035028C1049.958663 234.676191 814.413301 0 524.979332 0z" /></svg>
    </a>
    

    
    <a class="social-link" title="stackoverflow" href="https://stackoverflow.com/users/1925083/cizixs" target="_blank" rel="noopener">
        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M15 21h-10v-2h10v2zm6-11.665l-1.621-9.335-1.993.346 1.62 9.335 1.994-.346zm-5.964 6.937l-9.746-.975-.186 2.016 9.755.879.177-1.92zm.538-2.587l-9.276-2.608-.526 1.954 9.306 2.5.496-1.846zm1.204-2.413l-8.297-4.864-1.029 1.743 8.298 4.865 1.028-1.744zm1.866-1.467l-5.339-7.829-1.672 1.14 5.339 7.829 1.672-1.14zm-2.644 4.195v8h-12v-8h-2v10h16v-10h-2z"/></svg>
    </a>
    

    

    
    <a class="social-link" title="twitter" href="https://twitter.com/cizixs" target="_blank" rel="noopener">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M30.063 7.313c-.813 1.125-1.75 2.125-2.875 2.938v.75c0 1.563-.188 3.125-.688 4.625a15.088 15.088 0 0 1-2.063 4.438c-.875 1.438-2 2.688-3.25 3.813a15.015 15.015 0 0 1-4.625 2.563c-1.813.688-3.75 1-5.75 1-3.25 0-6.188-.875-8.875-2.625.438.063.875.125 1.375.125 2.688 0 5.063-.875 7.188-2.5-1.25 0-2.375-.375-3.375-1.125s-1.688-1.688-2.063-2.875c.438.063.813.125 1.125.125.5 0 1-.063 1.5-.25-1.313-.25-2.438-.938-3.313-1.938a5.673 5.673 0 0 1-1.313-3.688v-.063c.813.438 1.688.688 2.625.688a5.228 5.228 0 0 1-1.875-2c-.5-.875-.688-1.813-.688-2.75 0-1.063.25-2.063.75-2.938 1.438 1.75 3.188 3.188 5.25 4.25s4.313 1.688 6.688 1.813a5.579 5.579 0 0 1 1.5-5.438c1.125-1.125 2.5-1.688 4.125-1.688s3.063.625 4.188 1.813a11.48 11.48 0 0 0 3.688-1.375c-.438 1.375-1.313 2.438-2.563 3.188 1.125-.125 2.188-.438 3.313-.875z"/></svg>

    </a>
    

    
    <a class="social-link" title="instagram" href="https://www.instagram.com/cizixs/" target="_blank" rel="noopener">
        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z"/></svg>
    </a>
    
    
    
</div>
    </div>
</nav>
        
        <div class="site-header-content">
            
            <h1 class="site-title">
                Archives
            </h1>
            <h2 class="site-description">Total: 114</h2>
        </div>
        
        
    </div>
</header>


<main id="site-main" class="site-main outer" role="main">
	<div class="inner">
		<div class="post-feed">
			
			<article class="post-card post  no-image ">
				
				<div class="post-card-content">
					<a class="post-card-content-link" title="Go 语言 JSON 简介" href="/2016/12/19/golang-json-guide/">
						<header class="post-card-header">
							<span class="post-card-tags">
								
								
								blog
								| 
								
								<time datetime="2016-12-18T16:00:00.000Z" itemprop="datePublished">
									2016-12-19
								</time>
							</span>
							<h2 class="post-card-title">Go 语言 JSON 简介</h2>
						</header>
						<section class="post-card-excerpt">
							<p>
								
								
								
								
								
								简介JSON（JavaScript Object Notation） 是一种轻量级的数据交换格式，因为易读性、机器容易处理而变得流行。
JSON 语言定义的内容非常简洁，主要分为三种类型：对象（object）、数组（array）和基本类型（value）。基本类型（value）包括：

string 字符串，双引号括起来的 unciode 字符序列
number 数字，可以是整数，也可以是浮点数，但是不支持八进制和十六进制表示的数字
true，false 真值和假值，一般对应语
								...
							</p>
						</section>
					</a>
					<footer class="post-card-meta">
						<ul class="author-list">
							<li class="author-list-item">
								<div class="author-name-tooltip">Cizixs Wu</div>
								
								<a href="/about" class="static-avatar">
									<img class="author-profile-image" src="https://cizixs-blog.oss-cn-beijing.aliyuncs.com/006tNc79ly1g1qxhqq5mvj30u00xqgp3.jpg" alt="Cizixs Wu" />
								</a>
								
							</li>
						</ul>
						<span class="reading-time">
							16
							 min read
						</span>
					</footer>
				</div>
			</article>
			
			<article class="post-card post  no-image ">
				
				<div class="post-card-content">
					<a class="post-card-content-link" title="跟着 Github 学习 Restful HTTP API 设计" href="/2016/12/12/restful-api-design-guide/">
						<header class="post-card-header">
							<span class="post-card-tags">
								
								
								blog
								| 
								
								<time datetime="2016-12-11T16:00:00.000Z" itemprop="datePublished">
									2016-12-12
								</time>
							</span>
							<h2 class="post-card-title">跟着 Github 学习 Restful HTTP API 设计</h2>
						</header>
						<section class="post-card-excerpt">
							<p>
								
								
								
								
								
								近几年提供 HTTP API 服务的公司越来越多，许多公司都把 API 作为产品重要的一部分，作为服务提供出去。而微服务的兴起，也让企业内部开始重视和频繁使用 HTTP API 。好的 HTTP API 设计容易理解、符合 RFC 标准、提供使用者便利的功能，其中经常被拿来作为教科书典范的当属 Github API。这篇文章就通过 Github API 总结了一些非常好的设计原则，可以作为以后要编写 HTTP API 的参考。
注意：这篇文章只讨论设计原则，不是强制要求（AP
								...
							</p>
						</section>
					</a>
					<footer class="post-card-meta">
						<ul class="author-list">
							<li class="author-list-item">
								<div class="author-name-tooltip">Cizixs Wu</div>
								
								<a href="/about" class="static-avatar">
									<img class="author-profile-image" src="https://cizixs-blog.oss-cn-beijing.aliyuncs.com/006tNc79ly1g1qxhqq5mvj30u00xqgp3.jpg" alt="Cizixs Wu" />
								</a>
								
							</li>
						</ul>
						<span class="reading-time">
							16
							 min read
						</span>
					</footer>
				</div>
			</article>
			
			<article class="post-card post  no-image ">
				
				<div class="post-card-content">
					<a class="post-card-content-link" title="使用 coreos 运行 docker 的 netns 问题" href="/2016/11/22/coreos-docker-netns-issue/">
						<header class="post-card-header">
							<span class="post-card-tags">
								
								
								blog
								| 
								
								<time datetime="2016-11-21T16:00:00.000Z" itemprop="datePublished">
									2016-11-22
								</time>
							</span>
							<h2 class="post-card-title">使用 coreos 运行 docker 的 netns 问题</h2>
						</header>
						<section class="post-card-excerpt">
							<p>
								
								
								
								
								
								背景知识docker 把所有的 network namespace 放在 /var/run/docker/netns 目录下面，要进入到 network namespace 有两种方法：

使用 nsenter：nsenter --net=/var/run/docker/netns/&lt;uuid&gt; ip addr ，可以使用 nsenter --net=/var/run/docker/netns/&lt;uuid&gt; sh 进入到该 ns 的 shell 中，后
								...
							</p>
						</section>
					</a>
					<footer class="post-card-meta">
						<ul class="author-list">
							<li class="author-list-item">
								<div class="author-name-tooltip">Cizixs Wu</div>
								
								<a href="/about" class="static-avatar">
									<img class="author-profile-image" src="https://cizixs-blog.oss-cn-beijing.aliyuncs.com/006tNc79ly1g1qxhqq5mvj30u00xqgp3.jpg" alt="Cizixs Wu" />
								</a>
								
							</li>
						</ul>
						<span class="reading-time">
							7
							 min read
						</span>
					</footer>
				</div>
			</article>
			
			<article class="post-card post  no-image ">
				
				<div class="post-card-content">
					<a class="post-card-content-link" title="kubernetes 简介：API Server 和 node" href="/2016/11/07/kubernetes-intro-api-server/">
						<header class="post-card-header">
							<span class="post-card-tags">
								
								
								blog
								| 
								
								<time datetime="2016-11-06T16:00:00.000Z" itemprop="datePublished">
									2016-11-07
								</time>
							</span>
							<h2 class="post-card-title">kubernetes 简介：API Server 和 node</h2>
						</header>
						<section class="post-card-excerpt">
							<p>
								
								
								
								
								
								简介这篇文章是整个系统的第二篇，上一篇文章讲解了 kubelet 的功能和使用。
在 kubernetes 集群中，API Server 有着非常重要的角色。API Server 负责和 etcd 交互（其他组件不会直接操作 etcd，只有 API Server 这么做），是整个 kubernetes 集群的数据中心，所有的交互都是以 API Server 为核心的。简单来说，API Server 提供了一下的功能：

整个集群管理的 API 接口：所有对集群进行的查询和管理
								...
							</p>
						</section>
					</a>
					<footer class="post-card-meta">
						<ul class="author-list">
							<li class="author-list-item">
								<div class="author-name-tooltip">Cizixs Wu</div>
								
								<a href="/about" class="static-avatar">
									<img class="author-profile-image" src="https://cizixs-blog.oss-cn-beijing.aliyuncs.com/006tNc79ly1g1qxhqq5mvj30u00xqgp3.jpg" alt="Cizixs Wu" />
								</a>
								
							</li>
						</ul>
						<span class="reading-time">
							52
							 min read
						</span>
					</footer>
				</div>
			</article>
			
			<article class="post-card post  no-image ">
				
				<div class="post-card-content">
					<a class="post-card-content-link" title="kubernetes 简介： kubelet 和 pod" href="/2016/10/25/kubernetes-intro-kubelet/">
						<header class="post-card-header">
							<span class="post-card-tags">
								
								
								blog
								| 
								
								<time datetime="2016-10-24T16:00:00.000Z" itemprop="datePublished">
									2016-10-25
								</time>
							</span>
							<h2 class="post-card-title">kubernetes 简介： kubelet 和 pod</h2>
						</header>
						<section class="post-card-excerpt">
							<p>
								
								
								
								
								
								简介kubernetes 是一个分布式的集群管理系统，在每个节点（node）上都要运行一个 worker 对容器进行生命周期的管理，这个 worker 程序就是 kubelet。
简单地说，kubelet 的主要功能就是定时从某个地方获取节点上 pod/container 的期望状态（运行什么容器、运行的副本数量、网络或者存储如何配置等等），并调用对应的容器平台接口达到这个状态。
集群状态下，kubelet 会从 master 上读取信息，但其实 kubelet 还可以从其他
								...
							</p>
						</section>
					</a>
					<footer class="post-card-meta">
						<ul class="author-list">
							<li class="author-list-item">
								<div class="author-name-tooltip">Cizixs Wu</div>
								
								<a href="/about" class="static-avatar">
									<img class="author-profile-image" src="https://cizixs-blog.oss-cn-beijing.aliyuncs.com/006tNc79ly1g1qxhqq5mvj30u00xqgp3.jpg" alt="Cizixs Wu" />
								</a>
								
							</li>
						</ul>
						<span class="reading-time">
							41
							 min read
						</span>
					</footer>
				</div>
			</article>
			
			<article class="post-card post  no-image ">
				
				<div class="post-card-content">
					<a class="post-card-content-link" title="go http 服务器编程" href="/2016/08/17/golang-http-server-side/">
						<header class="post-card-header">
							<span class="post-card-tags">
								
								
								blog
								| 
								
								<time datetime="2016-08-16T16:00:00.000Z" itemprop="datePublished">
									2016-08-17
								</time>
							</span>
							<h2 class="post-card-title">go http 服务器编程</h2>
						</header>
						<section class="post-card-excerpt">
							<p>
								
								
								
								
								
								1. 初识http 是典型的 C/S 架构，客户端向服务端发送请求（request），服务端做出应答（response）。
golang 的标准库 net/http 提供了 http 编程有关的接口，封装了内部TCP连接和报文解析的复杂琐碎的细节，使用者只需要和 http.request 和 http.ResponseWriter 两个对象交互就行。也就是说，我们只要写一个 handler，请求会通过参数传递进来，而它要做的就是根据请求的数据做处理，把结果写到 Respons
								...
							</p>
						</section>
					</a>
					<footer class="post-card-meta">
						<ul class="author-list">
							<li class="author-list-item">
								<div class="author-name-tooltip">Cizixs Wu</div>
								
								<a href="/about" class="static-avatar">
									<img class="author-profile-image" src="https://cizixs-blog.oss-cn-beijing.aliyuncs.com/006tNc79ly1g1qxhqq5mvj30u00xqgp3.jpg" alt="Cizixs Wu" />
								</a>
								
							</li>
						</ul>
						<span class="reading-time">
							55
							 min read
						</span>
					</footer>
				</div>
			</article>
			
			<article class="post-card post  no-image ">
				
				<div class="post-card-content">
					<a class="post-card-content-link" title="etcd 使用入门" href="/2016/08/02/intro-to-etcd/">
						<header class="post-card-header">
							<span class="post-card-tags">
								
								
								blog
								| 
								
								<time datetime="2016-08-01T16:00:00.000Z" itemprop="datePublished">
									2016-08-02
								</time>
							</span>
							<h2 class="post-card-title">etcd 使用入门</h2>
						</header>
						<section class="post-card-excerpt">
							<p>
								
								
								
								
								
								1. etcd 简介coreos 开发的分布式服务系统，内部采用 raft 协议作为一致性算法。作为服务发现系统，有以下的特点：

简单：安装配置简单，而且提供了 HTTP API 进行交互，使用也很简单
安全：支持 SSL 证书验证
快速：根据官方提供的 benchmark 数据，单实例支持每秒 2k+ 读操作
可靠：采用 raft 算法，实现分布式系统数据的可用性和一致性

在这篇文章编写的时候，etcd 已经发布了 3.0.4 版本，被被用在 CoreOS、kubern
								...
							</p>
						</section>
					</a>
					<footer class="post-card-meta">
						<ul class="author-list">
							<li class="author-list-item">
								<div class="author-name-tooltip">Cizixs Wu</div>
								
								<a href="/about" class="static-avatar">
									<img class="author-profile-image" src="https://cizixs-blog.oss-cn-beijing.aliyuncs.com/006tNc79ly1g1qxhqq5mvj30u00xqgp3.jpg" alt="Cizixs Wu" />
								</a>
								
							</li>
						</ul>
						<span class="reading-time">
							71
							 min read
						</span>
					</footer>
				</div>
			</article>
			
			<article class="post-card post  no-image ">
				
				<div class="post-card-content">
					<a class="post-card-content-link" title="flannel 源码分析" href="/2016/07/16/flannel-source-code-insight/">
						<header class="post-card-header">
							<span class="post-card-tags">
								
								
								blog
								| 
								
								<time datetime="2016-07-15T16:00:00.000Z" itemprop="datePublished">
									2016-07-16
								</time>
							</span>
							<h2 class="post-card-title">flannel 源码分析</h2>
						</header>
						<section class="post-card-excerpt">
							<p>
								
								
								
								
								
								简介flannel 是为了解决容器的跨主机网络问题而出现的项目，可以提供多种类型的网络模型：

普通网络：udp、vxlan、hostgw
平台网络：gce、aws

使用之前，需要在 etcd 中写入要管理网络的配置，比如 ：
{
    &quot;Network&quot;: &quot;10.0.0.0/8&quot;,
    &quot;SubnetLen&quot;: 20,
    &quot;SubnetMin&quot;: &quot;10.10.0.0&
								...
							</p>
						</section>
					</a>
					<footer class="post-card-meta">
						<ul class="author-list">
							<li class="author-list-item">
								<div class="author-name-tooltip">Cizixs Wu</div>
								
								<a href="/about" class="static-avatar">
									<img class="author-profile-image" src="https://cizixs-blog.oss-cn-beijing.aliyuncs.com/006tNc79ly1g1qxhqq5mvj30u00xqgp3.jpg" alt="Cizixs Wu" />
								</a>
								
							</li>
						</ul>
						<span class="reading-time">
							32
							 min read
						</span>
					</footer>
				</div>
			</article>
			
			<article class="post-card post  no-image ">
				
				<div class="post-card-content">
					<a class="post-card-content-link" title="kubernetes 简介：kubernetes 架构介绍" href="/2016/07/12/kubernetes-intro/">
						<header class="post-card-header">
							<span class="post-card-tags">
								
								
								blog
								| 
								
								<time datetime="2016-07-11T16:00:00.000Z" itemprop="datePublished">
									2016-07-12
								</time>
							</span>
							<h2 class="post-card-title">kubernetes 简介：kubernetes 架构介绍</h2>
						</header>
						<section class="post-card-excerpt">
							<p>
								
								
								
								
								
								什么是 kubernetes？kubernetes （经常被缩写成 k8s）是 google 开源的一套自动化容器管理平台，前身是 Borg，用于容器的部署、自动化调度和集群管理。目前 kubernetes 有以下的特性：

容器的自动化部署
自动化扩展或者缩容
自动化应用/服务升级
容器成组，对外提供服务，支持负载均衡
服务的健康检查，自动重启

因为容器本身就是可移植的，所以 kubernetes 容器集群也能跑在私有云、公有云或者混合云上面。
kubernetes 让应
								...
							</p>
						</section>
					</a>
					<footer class="post-card-meta">
						<ul class="author-list">
							<li class="author-list-item">
								<div class="author-name-tooltip">Cizixs Wu</div>
								
								<a href="/about" class="static-avatar">
									<img class="author-profile-image" src="https://cizixs-blog.oss-cn-beijing.aliyuncs.com/006tNc79ly1g1qxhqq5mvj30u00xqgp3.jpg" alt="Cizixs Wu" />
								</a>
								
							</li>
						</ul>
						<span class="reading-time">
							8
							 min read
						</span>
					</footer>
				</div>
			</article>
			
			<article class="post-card post  no-image ">
				
				<div class="post-card-content">
					<a class="post-card-content-link" title="weave 网络模型" href="/2016/06/30/weave-network/">
						<header class="post-card-header">
							<span class="post-card-tags">
								
								
								blog
								| 
								
								<time datetime="2016-06-29T16:00:00.000Z" itemprop="datePublished">
									2016-06-30
								</time>
							</span>
							<h2 class="post-card-title">weave 网络模型</h2>
						</header>
						<section class="post-card-excerpt">
							<p>
								
								
								
								
								
								简介weave 是 weaveworks 公司核心项目，也是解决 docker 网络问题的。和其他项目比较，weave 提供的功能更多，和其他系统的集成更完善。
weave 不会修改 docker 也有的网络配置，而是添加在容器中添加额外的虚拟网卡来搭建自己的网络。
安装老规矩，下面所有的环境都是在我 mac 笔记本上通过 docker-machine 创建和运行的。
这次我们就创建两台虚拟主机，主机名分别为 weave-1 和 weave-2。请确保你安装的 docker 
								...
							</p>
						</section>
					</a>
					<footer class="post-card-meta">
						<ul class="author-list">
							<li class="author-list-item">
								<div class="author-name-tooltip">Cizixs Wu</div>
								
								<a href="/about" class="static-avatar">
									<img class="author-profile-image" src="https://cizixs-blog.oss-cn-beijing.aliyuncs.com/006tNc79ly1g1qxhqq5mvj30u00xqgp3.jpg" alt="Cizixs Wu" />
								</a>
								
							</li>
						</ul>
						<span class="reading-time">
							14
							 min read
						</span>
					</footer>
				</div>
			</article>
			
			<article class="post-card post  no-image ">
				
				<div class="post-card-content">
					<a class="post-card-content-link" title="flannel 网络模型" href="/2016/06/15/flannel-overlay-network/">
						<header class="post-card-header">
							<span class="post-card-tags">
								
								
								blog
								| 
								
								<time datetime="2016-06-14T16:00:00.000Z" itemprop="datePublished">
									2016-06-15
								</time>
							</span>
							<h2 class="post-card-title">flannel 网络模型</h2>
						</header>
						<section class="post-card-excerpt">
							<p>
								
								
								
								
								
								简介Flannel 是CoreOS 下面的一个项目，目前被使用在 kubernetes 中，用于解决 docker 容器直接跨主机的通信问题。它的主要思路是：预先留出一个网段，每个主机使用其中一部分，然后每个容器被分配不同的 ip；让所有的容器认为大家在同一个直连的网络，底层通过 UDP/VxLAN 等进行报文的封装和转发。这么说还是会很不清不楚，那么这篇文章就试图解释到底 flannel 是怎么回事，希望读完本文再来看这段话能够明白它的意思。
安装和配置启动主机docker
								...
							</p>
						</section>
					</a>
					<footer class="post-card-meta">
						<ul class="author-list">
							<li class="author-list-item">
								<div class="author-name-tooltip">Cizixs Wu</div>
								
								<a href="/about" class="static-avatar">
									<img class="author-profile-image" src="https://cizixs-blog.oss-cn-beijing.aliyuncs.com/006tNc79ly1g1qxhqq5mvj30u00xqgp3.jpg" alt="Cizixs Wu" />
								</a>
								
							</li>
						</ul>
						<span class="reading-time">
							15
							 min read
						</span>
					</footer>
				</div>
			</article>
			
			<article class="post-card post  no-image ">
				
				<div class="post-card-content">
					<a class="post-card-content-link" title="docker 跨主机网络：overlay 简介" href="/2016/06/13/docker-overlay-network/">
						<header class="post-card-header">
							<span class="post-card-tags">
								
								
								blog
								| 
								
								<time datetime="2016-06-12T16:00:00.000Z" itemprop="datePublished">
									2016-06-13
								</time>
							</span>
							<h2 class="post-card-title">docker 跨主机网络：overlay 简介</h2>
						</header>
						<section class="post-card-excerpt">
							<p>
								
								
								
								
								
								简介docker 在早前的时候没有考虑跨主机的容器通信，这个特性直到 docker 1.9 才出现。在此之前，如果希望位于不同主机的容器能够通信，一般有几种方法：

使用端口映射：直接把容器的服务端口映射到主机上，主机直接通过映射出来的端口通信
把容器放到主机所在的网段：修改 docker 的 ip 分配网段和主机一致，还要修改主机的网络结构
第三方项目：flannel，weave 或者 pipework 等，这些方案一般都是通过 SDN 搭建 overlay 网络达到容器通
								...
							</p>
						</section>
					</a>
					<footer class="post-card-meta">
						<ul class="author-list">
							<li class="author-list-item">
								<div class="author-name-tooltip">Cizixs Wu</div>
								
								<a href="/about" class="static-avatar">
									<img class="author-profile-image" src="https://cizixs-blog.oss-cn-beijing.aliyuncs.com/006tNc79ly1g1qxhqq5mvj30u00xqgp3.jpg" alt="Cizixs Wu" />
								</a>
								
							</li>
						</ul>
						<span class="reading-time">
							44
							 min read
						</span>
					</footer>
				</div>
			</article>
			
			<article class="post-card post  no-image ">
				
				<div class="post-card-content">
					<a class="post-card-content-link" title="docker 容器的网络模式" href="/2016/06/12/docker-network-modes-explained/">
						<header class="post-card-header">
							<span class="post-card-tags">
								
								
								blog
								| 
								
								<time datetime="2016-06-11T16:00:00.000Z" itemprop="datePublished">
									2016-06-12
								</time>
							</span>
							<h2 class="post-card-title">docker 容器的网络模式</h2>
						</header>
						<section class="post-card-excerpt">
							<p>
								
								
								
								
								
								简介docker 默认提供了四种模式，供容器启动的时候选择：bridge、none、container、host。前一篇文章已经介绍了 bridge 模式，这篇文章就介绍剩下的三种模式，已经它们可能的使用场景。

测试环境说明一下这篇文章中所有测试的基本配置和环境信息：
所有测试都是运行在 Mac 上的 virtualbox 虚拟机中，使用 docker toolbox 管理 docker 主机，使用说明可以参考之前的文章。

Mac OS
virtualbox 5.0.20
								...
							</p>
						</section>
					</a>
					<footer class="post-card-meta">
						<ul class="author-list">
							<li class="author-list-item">
								<div class="author-name-tooltip">Cizixs Wu</div>
								
								<a href="/about" class="static-avatar">
									<img class="author-profile-image" src="https://cizixs-blog.oss-cn-beijing.aliyuncs.com/006tNc79ly1g1qxhqq5mvj30u00xqgp3.jpg" alt="Cizixs Wu" />
								</a>
								
							</li>
						</ul>
						<span class="reading-time">
							24
							 min read
						</span>
					</footer>
				</div>
			</article>
			
			<article class="post-card post  no-image ">
				
				<div class="post-card-content">
					<a class="post-card-content-link" title="docker 容器默认的网络模型" href="/2016/06/01/docker-default-network/">
						<header class="post-card-header">
							<span class="post-card-tags">
								
								
								blog
								| 
								
								<time datetime="2016-05-31T16:00:00.000Z" itemprop="datePublished">
									2016-06-01
								</time>
							</span>
							<h2 class="post-card-title">docker 容器默认的网络模型</h2>
						</header>
						<section class="post-card-excerpt">
							<p>
								
								
								
								
								
								简介这篇文章介绍我们启动容器的时候，默认情况下 docker 是怎么组织网络，保证容器是可以连通的。
这里将不再介绍 docker 的基础使用，而是默认读者已经熟悉了 docker 各种命令行和概念，能创建、运行、查看容器。
除此之外，还需要有一定的网络基础知识，包括但是不限于：

二层网络和三层网络的区别和作用
ip 命令的使用
linux network namespace 的概念
virtual bridge 的概念
veth pair 的功能

好，下面就让我们开始吧
								...
							</p>
						</section>
					</a>
					<footer class="post-card-meta">
						<ul class="author-list">
							<li class="author-list-item">
								<div class="author-name-tooltip">Cizixs Wu</div>
								
								<a href="/about" class="static-avatar">
									<img class="author-profile-image" src="https://cizixs-blog.oss-cn-beijing.aliyuncs.com/006tNc79ly1g1qxhqq5mvj30u00xqgp3.jpg" alt="Cizixs Wu" />
								</a>
								
							</li>
						</ul>
						<span class="reading-time">
							22
							 min read
						</span>
					</footer>
				</div>
			</article>
			
			<article class="post-card post  no-image ">
				
				<div class="post-card-content">
					<a class="post-card-content-link" title="在 mac 系统配置 docker 开发环境" href="/2016/05/31/install-docker-dev-environment-on-mac/">
						<header class="post-card-header">
							<span class="post-card-tags">
								
								
								blog
								| 
								
								<time datetime="2016-05-30T16:00:00.000Z" itemprop="datePublished">
									2016-05-31
								</time>
							</span>
							<h2 class="post-card-title">在 mac 系统配置 docker 开发环境</h2>
						</header>
						<section class="post-card-excerpt">
							<p>
								
								
								
								
								
								在这篇文章中，我们将介绍如何在 mac 平台下使用 docker toolbox 中提供的工具来运行第一个 docker 容器。
在 Mac 上安装 docker 环境docker 提供了 toolbox 方便 windows 和 mac 下运行容器，主要的功能组件有：

docker-machine：管理 docker 主机，支持在 virtualbox、digitalocean、azure、rackspace 等上面直接创建一个安装了 docker 的主机。我们主要使用这
								...
							</p>
						</section>
					</a>
					<footer class="post-card-meta">
						<ul class="author-list">
							<li class="author-list-item">
								<div class="author-name-tooltip">Cizixs Wu</div>
								
								<a href="/about" class="static-avatar">
									<img class="author-profile-image" src="https://cizixs-blog.oss-cn-beijing.aliyuncs.com/006tNc79ly1g1qxhqq5mvj30u00xqgp3.jpg" alt="Cizixs Wu" />
								</a>
								
							</li>
						</ul>
						<span class="reading-time">
							14
							 min read
						</span>
					</footer>
				</div>
			</article>
			
			<article class="post-card post  no-image ">
				
				<div class="post-card-content">
					<a class="post-card-content-link" title="Python BaseHTTPServer 介绍" href="/2016/05/20/python-httpserver/">
						<header class="post-card-header">
							<span class="post-card-tags">
								
								
								blog
								| 
								
								<time datetime="2016-05-19T16:00:00.000Z" itemprop="datePublished">
									2016-05-20
								</time>
							</span>
							<h2 class="post-card-title">Python BaseHTTPServer 介绍</h2>
						</header>
						<section class="post-card-excerpt">
							<p>
								
								
								
								
								
								本文针对 python 2.7 版本，介绍了 BaseHTTPServer 这个库的使用方法。
这个库是 python 自带的标准库的一部分，不需要额外安装，在 linux 系统下，位置在 /usr/lib/python2.7/BaseHTTPServer.py。
HTTP 协议HTTP 请求（request）http 请求分为三个部分：

第一行：请求类型、地址和版本号
头部信息：HTTP header
数据部分

标准的 HTTP 请求是：
GET / HTTP/1.1

								...
							</p>
						</section>
					</a>
					<footer class="post-card-meta">
						<ul class="author-list">
							<li class="author-list-item">
								<div class="author-name-tooltip">Cizixs Wu</div>
								
								<a href="/about" class="static-avatar">
									<img class="author-profile-image" src="https://cizixs-blog.oss-cn-beijing.aliyuncs.com/006tNc79ly1g1qxhqq5mvj30u00xqgp3.jpg" alt="Cizixs Wu" />
								</a>
								
							</li>
						</ul>
						<span class="reading-time">
							15
							 min read
						</span>
					</footer>
				</div>
			</article>
			
			<article class="post-card post  no-image ">
				
				<div class="post-card-content">
					<a class="post-card-content-link" title="docker 镜像介绍" href="/2016/04/06/docker-images/">
						<header class="post-card-header">
							<span class="post-card-tags">
								
								
								blog
								| 
								
								<time datetime="2016-04-05T16:00:00.000Z" itemprop="datePublished">
									2016-04-06
								</time>
							</span>
							<h2 class="post-card-title">docker 镜像介绍</h2>
						</header>
						<section class="post-card-excerpt">
							<p>
								
								
								
								
								
								这篇文章主要讲讲 docker 中镜像有关的知识，将涉及到下面几个方面：

docker images 命令的使用
docker 和 registry 交互的过程，pull 命令到底做了什么
docker storage driver
aufs 的格式和实际的组织结构
Dockerfile 原语和 docker 镜像之间的关系

简介

docker 镜像代表了容器的文件系统里的内容，是容器的基础，镜像一般是通过 Dockerfile 生成的
docker 的镜像是分层的，所
								...
							</p>
						</section>
					</a>
					<footer class="post-card-meta">
						<ul class="author-list">
							<li class="author-list-item">
								<div class="author-name-tooltip">Cizixs Wu</div>
								
								<a href="/about" class="static-avatar">
									<img class="author-profile-image" src="https://cizixs-blog.oss-cn-beijing.aliyuncs.com/006tNc79ly1g1qxhqq5mvj30u00xqgp3.jpg" alt="Cizixs Wu" />
								</a>
								
							</li>
						</ul>
						<span class="reading-time">
							35
							 min read
						</span>
					</footer>
				</div>
			</article>
			
			<article class="post-card post  no-image ">
				
				<div class="post-card-content">
					<a class="post-card-content-link" title="nova compute service 启动过程" href="/2016/02/25/nova-service-insight/">
						<header class="post-card-header">
							<span class="post-card-tags">
								
								
								blog
								| 
								
								<time datetime="2016-02-24T16:00:00.000Z" itemprop="datePublished">
									2016-02-25
								</time>
							</span>
							<h2 class="post-card-title">nova compute service 启动过程</h2>
						</header>
						<section class="post-card-excerpt">
							<p>
								
								
								
								
								
								
OS 版本：Ubuntu 12.04
openstack 版本：icehouse

我们知道 nova-compute 服务可以通过:
service nova-compute status/start/stop/restart
进行管理，我们可以从 /etc/init/nova-compute.conf 文件看到，背后调用的是 /usr/bin/nova-compute 可执行文件。这个文件的内容比较简单，主要调用 nova.cmd.compute:main 函数运行，我
								...
							</p>
						</section>
					</a>
					<footer class="post-card-meta">
						<ul class="author-list">
							<li class="author-list-item">
								<div class="author-name-tooltip">Cizixs Wu</div>
								
								<a href="/about" class="static-avatar">
									<img class="author-profile-image" src="https://cizixs-blog.oss-cn-beijing.aliyuncs.com/006tNc79ly1g1qxhqq5mvj30u00xqgp3.jpg" alt="Cizixs Wu" />
								</a>
								
							</li>
						</ul>
						<span class="reading-time">
							10
							 min read
						</span>
					</footer>
				</div>
			</article>
			
			<article class="post-card post  no-image ">
				
				<div class="post-card-content">
					<a class="post-card-content-link" title="nova scheduler 原理介绍和源码解析" href="/2016/02/01/nova-scheduler-insight/">
						<header class="post-card-header">
							<span class="post-card-tags">
								
								
								blog
								| 
								
								<time datetime="2016-01-31T16:00:00.000Z" itemprop="datePublished">
									2016-02-01
								</time>
							</span>
							<h2 class="post-card-title">nova scheduler 原理介绍和源码解析</h2>
						</header>
						<section class="post-card-excerpt">
							<p>
								
								
								
								
								
								TL;DR
介绍在 openstack 中，scheduler 负责从宿主机（运行 nova-compute 的节点）中根据一系列的算法和参数（CPU 核数，可用 RAM，镜像类型等 ）选择出来一个，来部署虚拟机（instance）。openstack 官方网站上这张经典的图可以直观地看到 scheduler 的两个步骤：过滤（filter） + 权重计算（weighting）。

简单来说，过滤就是把不符合条件的宿主机去除掉，权重计算就是把剩下的主机根据某个值排序。如果这个
								...
							</p>
						</section>
					</a>
					<footer class="post-card-meta">
						<ul class="author-list">
							<li class="author-list-item">
								<div class="author-name-tooltip">Cizixs Wu</div>
								
								<a href="/about" class="static-avatar">
									<img class="author-profile-image" src="https://cizixs-blog.oss-cn-beijing.aliyuncs.com/006tNc79ly1g1qxhqq5mvj30u00xqgp3.jpg" alt="Cizixs Wu" />
								</a>
								
							</li>
						</ul>
						<span class="reading-time">
							50
							 min read
						</span>
					</footer>
				</div>
			</article>
			
			<article class="post-card post  no-image ">
				
				<div class="post-card-content">
					<a class="post-card-content-link" title="bottle 源码解析" href="/2016/01/20/dive-into-bottle/">
						<header class="post-card-header">
							<span class="post-card-tags">
								
								
								blog
								| 
								
								<time datetime="2016-01-19T16:00:00.000Z" itemprop="datePublished">
									2016-01-20
								</time>
							</span>
							<h2 class="post-card-title">bottle 源码解析</h2>
						</header>
						<section class="post-card-excerpt">
							<p>
								
								
								
								
								
								这篇文章不会讲如何使用 bottle，如果感兴趣，直接看它们的官方文档。主要讲讲 web 框架的一些东西，阅读之前最好对下面的这些知识有一定的了解：

熟悉 HTTP 协议
对 python 有一定的了解
知道 wsgi 是干什么的
写过 web 应用

如果不太了解 web 框架，可以阅读我之前的一篇文章：什么是 web 框架？。
简介bottle 是一个极简的 python web 框架，可以用来用来快速搭建 web 应用，并不是开发复杂项目的第一选择，因为它并没有提供配
								...
							</p>
						</section>
					</a>
					<footer class="post-card-meta">
						<ul class="author-list">
							<li class="author-list-item">
								<div class="author-name-tooltip">Cizixs Wu</div>
								
								<a href="/about" class="static-avatar">
									<img class="author-profile-image" src="https://cizixs-blog.oss-cn-beijing.aliyuncs.com/006tNc79ly1g1qxhqq5mvj30u00xqgp3.jpg" alt="Cizixs Wu" />
								</a>
								
							</li>
						</ul>
						<span class="reading-time">
							21
							 min read
						</span>
					</footer>
				</div>
			</article>
			
		</div>
	</div>
	
<nav class="pagination">
    
    
    
</nav>
</main>


        

<aside class="read-next outer">
    <div class="inner">
        <div class="read-next-feed">
            
            

<article class="read-next-card"  style="background-image: url(https://cizixs-blog.oss-cn-beijing.aliyuncs.com/006tNc79ly1g1qxcn9ft3j318w0txdo6.jpg)"  >
  <header class="read-next-card-header">
    <small class="read-next-card-header-sitetitle">&mdash; Cizixs Write Here &mdash;</small>
    <h3 class="read-next-card-header-title">Recent Posts</h3>
  </header>
  <div class="read-next-divider">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
      <path d="M13 14.5s2 3 5 3 5.5-2.463 5.5-5.5S21 6.5 18 6.5c-5 0-7 11-12 11C2.962 17.5.5 15.037.5 12S3 6.5 6 6.5s4.5 3.5 4.5 3.5"/>
    </svg>
  </div>
  <div class="read-next-card-content">
    <ul>
      
      
      
      <li>
        <a href="/2018/08/26/what-is-istio/">什么是 istio</a>
      </li>
      
      
      
      <li>
        <a href="/2018/08/25/knative-serverless-platform/">serverless 平台 knative 简介</a>
      </li>
      
      
      
      <li>
        <a href="/2018/06/25/kubernetes-resource-management/">kubernetes 资源管理概述</a>
      </li>
      
      
      
      <li>
        <a href="/2018/01/24/use-prometheus-and-grafana-to-monitor-linux-machine/">使用 promethues 和 grafana 监控自己的 linux 机器</a>
      </li>
      
      
      
      <li>
        <a href="/2018/01/13/linux-udp-packet-drop-debug/">linux 系统 UDP 丢包问题分析思路</a>
      </li>
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
    </ul>
  </div>
  <footer class="read-next-card-footer">
    <a href="/archives">  MORE  → </a>
  </footer>
</article>


            
            
            
        </div>
    </div>
</aside>


<footer class="site-footer outer">

	<div class="site-footer-content inner">
		<section class="copyright">
			<a href="/" title="Cizixs Write Here">Cizixs Write Here</a>
			&copy; 2019
		</section>
		<nav class="site-footer-nav">
			
            <a href="https://hexo.io" title="Hexo" target="_blank" rel="noopener">Hexo</a>
            <a href="https://github.com/xzhih/hexo-theme-casper" title="Casper" target="_blank" rel="noopener">Casper</a>
        </nav>
    </div>
</footer>




<script>
    /*!
  hey, [be]Lazy.js - v1.8.2 - 2016.10.25
  A fast, small and dependency free lazy load script (https://github.com/dinbror/blazy)
  (c) Bjoern Klinggaard - @bklinggaard - http://dinbror.dk/blazy
*/
  (function(q,m){"function"===typeof define&&define.amd?define(m):"object"===typeof exports?module.exports=m():q.Blazy=m()})(this,function(){function q(b){var c=b._util;c.elements=E(b.options);c.count=c.elements.length;c.destroyed&&(c.destroyed=!1,b.options.container&&l(b.options.container,function(a){n(a,"scroll",c.validateT)}),n(window,"resize",c.saveViewportOffsetT),n(window,"resize",c.validateT),n(window,"scroll",c.validateT));m(b)}function m(b){for(var c=b._util,a=0;a<c.count;a++){var d=c.elements[a],e;a:{var g=d;e=b.options;var p=g.getBoundingClientRect();if(e.container&&y&&(g=g.closest(e.containerClass))){g=g.getBoundingClientRect();e=r(g,f)?r(p,{top:g.top-e.offset,right:g.right+e.offset,bottom:g.bottom+e.offset,left:g.left-e.offset}):!1;break a}e=r(p,f)}if(e||t(d,b.options.successClass))b.load(d),c.elements.splice(a,1),c.count--,a--}0===c.count&&b.destroy()}function r(b,c){return b.right>=c.left&&b.bottom>=c.top&&b.left<=c.right&&b.top<=c.bottom}function z(b,c,a){if(!t(b,a.successClass)&&(c||a.loadInvisible||0<b.offsetWidth&&0<b.offsetHeight))if(c=b.getAttribute(u)||b.getAttribute(a.src)){c=c.split(a.separator);var d=c[A&&1<c.length?1:0],e=b.getAttribute(a.srcset),g="img"===b.nodeName.toLowerCase(),p=(c=b.parentNode)&&"picture"===c.nodeName.toLowerCase();if(g||void 0===b.src){var h=new Image,w=function(){a.error&&a.error(b,"invalid");v(b,a.errorClass);k(h,"error",w);k(h,"load",f)},f=function(){g?p||B(b,d,e):b.style.backgroundImage='url("'+d+'")';x(b,a);k(h,"load",f);k(h,"error",w)};p&&(h=b,l(c.getElementsByTagName("source"),function(b){var c=a.srcset,e=b.getAttribute(c);e&&(b.setAttribute("srcset",e),b.removeAttribute(c))}));n(h,"error",w);n(h,"load",f);B(h,d,e)}else b.src=d,x(b,a)}else"video"===b.nodeName.toLowerCase()?(l(b.getElementsByTagName("source"),function(b){var c=a.src,e=b.getAttribute(c);e&&(b.setAttribute("src",e),b.removeAttribute(c))}),b.load(),x(b,a)):(a.error&&a.error(b,"missing"),v(b,a.errorClass))}function x(b,c){v(b,c.successClass);c.success&&c.success(b);b.removeAttribute(c.src);b.removeAttribute(c.srcset);l(c.breakpoints,function(a){b.removeAttribute(a.src)})}function B(b,c,a){a&&b.setAttribute("srcset",a);b.src=c}function t(b,c){return-1!==(" "+b.className+" ").indexOf(" "+c+" ")}function v(b,c){t(b,c)||(b.className+=" "+c)}function E(b){var c=[];b=b.root.querySelectorAll(b.selector);for(var a=b.length;a--;c.unshift(b[a]));return c}function C(b){f.bottom=(window.innerHeight||document.documentElement.clientHeight)+b;f.right=(window.innerWidth||document.documentElement.clientWidth)+b}function n(b,c,a){b.attachEvent?b.attachEvent&&b.attachEvent("on"+c,a):b.addEventListener(c,a,{capture:!1,passive:!0})}function k(b,c,a){b.detachEvent?b.detachEvent&&b.detachEvent("on"+c,a):b.removeEventListener(c,a,{capture:!1,passive:!0})}function l(b,c){if(b&&c)for(var a=b.length,d=0;d<a&&!1!==c(b[d],d);d++);}function D(b,c,a){var d=0;return function(){var e=+new Date;e-d<c||(d=e,b.apply(a,arguments))}}var u,f,A,y;return function(b){if(!document.querySelectorAll){var c=document.createStyleSheet();document.querySelectorAll=function(a,b,d,h,f){f=document.all;b=[];a=a.replace(/\[for\b/gi,"[htmlFor").split(",");for(d=a.length;d--;){c.addRule(a[d],"k:v");for(h=f.length;h--;)f[h].currentStyle.k&&b.push(f[h]);c.removeRule(0)}return b}}var a=this,d=a._util={};d.elements=[];d.destroyed=!0;a.options=b||{};a.options.error=a.options.error||!1;a.options.offset=a.options.offset||100;a.options.root=a.options.root||document;a.options.success=a.options.success||!1;a.options.selector=a.options.selector||".b-lazy";a.options.separator=a.options.separator||"|";a.options.containerClass=a.options.container;a.options.container=a.options.containerClass?document.querySelectorAll(a.options.containerClass):!1;a.options.errorClass=a.options.errorClass||"b-error";a.options.breakpoints=a.options.breakpoints||!1;a.options.loadInvisible=a.options.loadInvisible||!1;a.options.successClass=a.options.successClass||"b-loaded";a.options.validateDelay=a.options.validateDelay||25;a.options.saveViewportOffsetDelay=a.options.saveViewportOffsetDelay||50;a.options.srcset=a.options.srcset||"data-srcset";a.options.src=u=a.options.src||"data-src";y=Element.prototype.closest;A=1<window.devicePixelRatio;f={};f.top=0-a.options.offset;f.left=0-a.options.offset;a.revalidate=function(){q(a)};a.load=function(a,b){var c=this.options;void 0===a.length?z(a,b,c):l(a,function(a){z(a,b,c)})};a.destroy=function(){var a=this._util;this.options.container&&l(this.options.container,function(b){k(b,"scroll",a.validateT)});k(window,"scroll",a.validateT);k(window,"resize",a.validateT);k(window,"resize",a.saveViewportOffsetT);a.count=0;a.elements.length=0;a.destroyed=!0};d.validateT=D(function(){m(a)},a.options.validateDelay,a);d.saveViewportOffsetT=D(function(){C(a.options.offset)},a.options.saveViewportOffsetDelay,a);C(a.options.offset);l(a.options.breakpoints,function(a){if(a.width>=window.screen.width)return u=a.src,!1});setTimeout(function(){q(a)})}});
    ;(function() {var bLazy = new Blazy();})();
</script>



    </div>
</body>
</html>
